﻿using System;

// XNA lib
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

//Oak Engine Lib
using OakEngine.GameState;
using OakEngine.Input;
using Microsoft.Xna.Framework.Input;

namespace MainJumpFleet.GameStates
{
  public  class InputMenuScreenState : OAK_IGameState
    {
                #region OAK_IGameState Members
        SpriteBatch batch;
        SpriteFont mainMenuFont;

        public InputMenuScreenState()
        {
            Enter();
        }


        public void Enter()
        {
            mainMenuFont = CGame.CGame.GetInstance().Content.Load<SpriteFont>("Fonts\\mainMenuFont");
            batch = CGame.CGame.GetInstance().SpriteBatch;
        }

        public bool Input(OAK_InputManager input)
        {

            if (input.Pressed(Keys.Escape) || input.Pressed(Buttons.Back, 0))
                CGame.CGame.GetInstance().ChangeState(new MainMenuState());
            if (input.Pressed(Keys.Space))
                timer = 0;

            return false;
        }
        static float timer ;
        public void Update(GameTime dt)
        {
            timer += (float)dt.ElapsedGameTime.TotalSeconds;
        }

        public void Render()
        {
            batch.DrawString(mainMenuFont, timer.ToString(), new Vector2(300,250), Color.White);
        
        }

        public void Exit()
        {
        }

        #endregion
    }
}
